//
//  PMPivotJoint.h
//  PezMonkey
//
//  Created by Spence DiNicolantonio on 10/31/09.
//  Copyright 2009 Necrosoft. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "PMCore.h"
#import "PMConstraint.h"


@interface PMPivotJoint : PMConstraint {

}

// Property definitions of getters/setters for data members stored by backend 
// Chipmunk structure. These properties are not synthesized, because their 
// implementations are given explicitly.
@property (assign) PMAnchor anchorA;
@property (assign) PMAnchor anchorB;
@property (assign) PMVect pivot;


#pragma mark -
#pragma mark Init
- (id)initWithBodyA:(PMBody *)aBody bodyB:(PMBody *)otherBody;
- (id)initWithAnchor:(PMAnchor)anchorA onBodyA:(PMBody *)aBody anchor:(PMAnchor)anchorB onBodyB:(PMBody *)otherBody; 
- (id)initWithBodyA:(PMBody *)aBody bodyB:(PMBody *)otherBody pivot:(PMVect)pivot;

#pragma mark Convenience
+ (PMPivotJoint *)pivotJointWithBodyA:(PMBody *)aBody bodyB:(PMBody *)otherBody;
+ (PMPivotJoint *)pivotJointWithAnchor:(PMAnchor)anchorA onBodyA:(PMBody *)aBody anchor:(PMAnchor)anchorB onBodyB:(PMBody *)otherBody; 
+ (PMPivotJoint *)pivotJointWithBodyA:(PMBody *)aBody bodyB:(PMBody *)otherBody pivot:(PMVect)pivot;


#pragma mark -
#pragma mark Getters
- (PMAnchor)anchorForBodyWithKey:(PMConstraintBodyKey)bodyKey;


#pragma mark -
#pragma mark Setters
- (void)setAnchor:(PMAnchor)anchor forBodyWithKey:(PMConstraintBodyKey)bodyKey;

@end
